#ifndef LOGINWINDOW_H
#define LOGINWINDOW_H

#include "customevent.h"
#include <QMainWindow>
#include <QSystemTrayIcon>
namespace Ui {
    class LoginWindow;
}


class ContactListView;
class LoginWidget;

class LoginWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit LoginWindow(QWidget *parent = 0);
    ~LoginWindow();
 void setVisible(bool visible);

protected slots:
    void iconActivated(QSystemTrayIcon::ActivationReason reason);
     void showMessage();
     void messageClicked();
     void logoffClicked();

protected:
     DECLARE_CUSTOM_EVENT()
     void onLogin();
     void onLogoff(int errorCode);
     virtual void closeEvent(QCloseEvent *event);

private:
    Ui::LoginWindow *ui;
    ContactListView* contactList;
    LoginWidget*    loginWidget;
    QSystemTrayIcon& trayIcon;

    QAction *minimizeAction;
      QAction *maximizeAction;
      QAction *restoreAction;
      QAction *quitAction;

};

#endif // LOGINWINDOW_H
